package br.urca.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class SolicitacaoCarteirinhaPK implements Serializable {
	
	private static final long serialVersionUID = 1L;

	@Column(name = "cdalucur", columnDefinition = "VARCHAR(11)")
	private String matricula;
	
	@Column(name = "via")
	private short via;
	
	public SolicitacaoCarteirinhaPK() { }

	public SolicitacaoCarteirinhaPK(String matricula, short via) {
		super();
		this.matricula = matricula;
		this.via = via;
	}

	public String getMatricula() {
		return matricula;
	}

	public void setMatricula(String matricula) {
		this.matricula = matricula;
	}

	public short getVia() {
		return via;
	}

	public void setVia(short via) {
		this.via = via;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((matricula == null) ? 0 : matricula.hashCode());
		result = prime * result + via;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SolicitacaoCarteirinhaPK other = (SolicitacaoCarteirinhaPK) obj;
		if (matricula == null) {
			if (other.matricula != null)
				return false;
		} else if (!matricula.equals(other.matricula))
			return false;
		if (via != other.via)
			return false;
		return true;
	}
	
	

}
